package org.pupil.register;

import org.pupil.common.constants.Register;
import org.pupil.register.zookeeper.CuratorZookeeperRegistry;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 注册中心工厂
 * @Author: pupil
 * @Date: 2024/07/10 下午 10:07
 */
public class RegistryFactory {

    private static Map<Register,RegistryService> registerServiceMap = new HashMap<>();

    static {
        registerServiceMap.put(Register.ZOOKEEPER,new CuratorZookeeperRegistry("127.0.0.1:2181"));
    }

    public static RegistryService get(Register register){
        return registerServiceMap.get(register);
    }
}
